/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MVC;

/**
 *
 * @author Prashanna
 */
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractAction;
import javax.swing.Action;

class MVCController {

	private MVC view;

	public MVCController(MVC _view) {
		view = _view;
		_view.addtest(new addtest());
		_view.addSpieler(new addSpieler());

	}

	class addtest implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			view.setText(view.txtname.getText() + "  "
					+ view.txtvorname.getText());
			view.DialogVisible(false);
		}
	}

	class addSpieler extends AbstractAction {
		public addSpieler() {
			putValue(Action.NAME, "Spieler 1");
		}

		public void actionPerformed(ActionEvent e) { // Methode wird
														// ausgeführt, wenn
														// Event eintritt
			view.DialogVisible(true);

		}
	}
}
